home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / May 96 / Re Feedbacks and Questions -.1 < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  2.3 KB  |  [TEXT/ttxt]

  1. Subject:     Re: Feedbacks and Questions - ODF R1
  2. Sent:        5/18/96 2:03 AM
  3. Received:    5/22/96 8:31 AM
  4. From:        Shinsaku Akogi, ak3s-akg@asahi-net.or.jp
  5. Reply-To:    ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8.  
  9. >>"ODFButton" is 
  10. >>rounded corner gadget, but when dropped on the document, it's rectangle.
  11. >>( That happens when the document's color is not white, as you know.) Is there
  12. >>a way to fix that with modification or should I wait for the next version?
  13. >
  14. >ODFButton doesn't even try to support that. The way to fix it to set the 
  15. >used shape using a rounded rectangle instead of a rectangle. Look at the 
  16. >OpenDoc programmer's guide about the used shape. You don't need to wait 
  17. >for the next release of ODF to fix that.
  18.  
  19. Hello,
  20. Given the suggestions above, I tried to modify ODFButton.
  21. I've read about used shape in OpenDoc Programmer's guide, but I was not
  22. sure where to put the methods like ChangeUsedShape and UsedShapeChanged
  23. ( Are these used in ODF? ). So what I did is modifying Draw method just as 
  24. the same as ODFClock does.
  25.  
  26. void CButtonFrame::Draw(Environment* ev, ODFacet* facet, 
  27.                                         ODShape* invalidShape)
  28. {
  29.         FW_CViewContext fc(ev, NULL, facet, invalidShape);
  30.         
  31.         // Just erase before the button draws itself
  32.         if (IsRoot(ev))
  33.         {
  34.                 FW_CRect invalidRect;
  35.                 fc.GetClipRect(invalidRect);
  36.                 FW_CRectShape::RenderRect(fc, invalidRect, FW_kFill, 
  37.                                                                
  38. FW_kWhiteEraseInk);
  39.         }
  40.         fc.SetMapping(fMapping);
  41.                 
  42.         this->DrawButtonFace(ev, fc);
  43. }
  44. void CButtonFrame::DrawButtonFace(Environment* ev, 
  45.                                                          FW_CGraphicContext& gc)
  46. {
  47.         FW_CRect ovalRect;
  48.         
  49.         FW_COvalShape::RenderOval(
  50.                 gc,
  51.                 ovalRect,
  52.                 FW_kFill,
  53.                 FW_kWhiteEraseInk);
  54. }
  55. Although I tried with roundRect, CW8 reports errors about FW_kFrame and 
  56. FW_kFill so I just did it to see what's gonna happen with oval. It just worked
  57. fine. But, still I feel I might be doing something wrong. Please give me any
  58. comments or suggestions.
  59.  
  60.                         Shinsaku Akogi ( ak3s-akg@asahi-net.or.jp ) 
  61.  
  62.         
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.